package com.niiwoo.activity.stage.enums.invite;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * tjb
 * 奖励类型(
 * 1.开通借款存管，2开通投资存管, #关联到表tab_invite_depositoryaccount
 * 3.首次借款账户充值，4.首次投资账户充值， #关联到表tab_invite_recharge
 * 5.推荐投资， #关联到表tab_invite_invest
 * 6推荐借款 #关联到表tab_invite_borrow
 * )
 */
@AllArgsConstructor
@Getter
public enum InviteDetailRewardTypeEnum {

    LOAN_ACCOUNT(Byte.valueOf("1"), "开通借款存管"),
    INVEST_ACCOUNT(Byte.valueOf("2"), "开通投资存管"),
    RECHARGE_LOAN(Byte.valueOf("3"), "首次借款账户充值"),
    RECHARGE_INVEST(Byte.valueOf("4"), "首次投资账户充值"),
    INVEST(Byte.valueOf("5"), "推荐投资"),
    LOAN(Byte.valueOf("6"), "推荐借款");

    private Byte code;
    private String desc;

    public static InviteDetailRewardTypeEnum valueOf(Byte code) {
        for (InviteDetailRewardTypeEnum typeEnum : InviteDetailRewardTypeEnum.values()) {
            if (code.byteValue() == typeEnum.getCode()) {
                return typeEnum;
            }
        }
        return null;
    }
}

